package com.shop.cloud.filter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.shop.cloud.util.IdWorker;

public class VersionInterceptor extends HandlerInterceptorAdapter {

	
	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//		if(CacheService.STATIC_FILE_VERSION==null){
			request.setAttribute("static_version", new IdWorker().getId());
//		}else {
//			request.setAttribute("static_version",CacheService.STATIC_FILE_VERSION);
//		}
		return true;
	}

}
